#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> a(n + 1);
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }

  vector<int> p(n + 1);

  for (int i = 1; i <= n; i++) {
    p[i] = i;
  }
  int cnt = 0;

  do {
    bool flag = true;
    for (int i = 1; i <= n; i++) {
      if (a[i] == -1)
        continue;
      if (p[i] != a[i]) {
        flag = false;
        break;
      }
    }
    if (flag) {
      cout << "Yes" << endl;
      for (int i = 1; i <= n; i++) {
        cout << p[i] << " ";
      }
      return 0;
    }
  } while (next_permutation(p.begin() + 1, p.begin() + n + 1));

  cout << "No";
  return 0;
}